<!DOCTYPE html>
<!--suppress ThymeleafVariablesResolveInspection-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all" />
    <link th:href="@{/assets/plugins/bootstrap/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/assets/plugins/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
    <link th:href="@{/assets/css/custom.css}" rel="stylesheet">
    <script th:src="@{/assets/plugins/jquery/jquery-3.1.0.min.js}"></script>
    <script th:src="@{/layui/layui.js}"></script>
</head>
<style>

    ::-webkit-scrollbar {display:none}/*隐藏横向滚动条但可以滚动*/
    .layui-form-label{
        width: 100px;
    }
</style>
<body>
<form class="layui-form">
    <input  name="studid" type="hidden" th:value="${student.studid}"/>
    <input  name="password" type="hidden" th:value="${student.password}"/>
    <div class="layui-form-item" style="margin-top: 20px">
        <label class="layui-form-label">学生姓名</label>
        <div class="layui-input-inline">
            <input  name="stuname" placeholder="学生姓名"  class="layui-input" th:value="${student.stuname}"/>
        </div>
        <label class="layui-form-label">毕业学校</label>
        <div class="layui-input-inline">
            <input  name="middleschool" placeholder="毕业学校" class="layui-input" th:value="${student.middleschool}"/>
        </div>
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <select name="sex">
                <option value="男" th:selected="${'男'==student.sex}">男</option>
                <option value="女" th:selected="${'女'==student.sex}">女</option>
            </select>
        </div>
        <label class="layui-form-label">年龄</label>
        <div class="layui-input-inline">
            <input  name="age" placeholder="年龄" autocomplete="off" class="layui-input" th:value="${student.age}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">出生年月</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="test2" name="birthday" required lay-verify="required" placeholder="出生年月" th:value="${student.birthday}"/>
        </div>
        <label class="layui-form-label">学生电话</label>
        <div class="layui-input-inline">
            <input  name="phone" placeholder="学生电话" autocomplete="off" class="layui-input" th:value="${student.phone}"/>
        </div>
        <label class="layui-form-label">家庭地址</label>
        <div class="layui-input-inline">
            <input  name="addr" placeholder="家庭地址" autocomplete="off" class="layui-input" th:value="${student.addr}"/>
        </div>
        <label class="layui-form-label">班级</label>
        <div class="layui-input-inline">
            <input  name="classname" placeholder="家庭地址" autocomplete="off" class="layui-input" th:value="${studentclasses.classname}" disabled="disabled" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">宿舍</label>
        <div class="layui-input-inline">
            <input  name="huorname" placeholder="宿舍" autocomplete="off" class="layui-input" th:value="${studenthuorList.huorname}" disabled="disabled"/>
        </div>
        <label class="layui-form-label">入学时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="test1" name="entertime" placeholder="入学时间" th:value="${student.entertime}">
        </div>
        <label class="layui-form-label">介绍老师</label>
        <div class="layui-input-inline">
            <input  name="emp_name" placeholder="介绍老师" autocomplete="off" class="layui-input" th:value="${empinfo.emp_name}" disabled="disabled"/>
        </div>
        <label class="layui-form-label">学生状态</label>
        <div class="layui-input-inline">
            <input  name="stat" placeholder="学生状态" autocomplete="off" class="layui-input" th:value="${student.stat}" disabled="disabled"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">民族</label>
        <div class="layui-input-inline">
            <input  name="nation" placeholder="民族" autocomplete="off" class="layui-input" th:value="${student.nation}"/>
        </div>
        <label class="layui-form-label">籍贯</label>
        <div class="layui-input-inline">
            <input  name="natives" placeholder="籍贯" autocomplete="off" class="layui-input" th:value="${student.natives}"/>
        </div>
        <label class="layui-form-label">户口性质</label>
        <div class="layui-input-inline">
            <input  name="residence" placeholder="户口性质" autocomplete="off" class="layui-input" th:value="${student.residence}"/>
        </div>
        <label class="layui-form-label">身份证号</label>
        <div class="layui-input-inline">
            <input  name="cardid" placeholder="身份证号" autocomplete="off" class="layui-input" th:value="${student.cardid}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">专业类别</label>
        <div class="layui-input-inline">
            <select id="themes" name="prolevel">
                <option th:each="class:${classtypeList}" th:value="${class.classtypename}" th:text="${class.classtypename}" th:selected="${class.classtypename==student.prolevel}"></option>
            </select>
        </div>
        <label class="layui-form-label">学习类别</label>
        <div class="layui-input-inline">
            <select name="studytype">
                <option value="全日制" th:selected="${'全日制'==student.studytype}">全日制</option>
                <option value="函授" th:selected="${'函授'==student.studytype}">函授</option>
            </select>
        </div>
        <label class="layui-form-label">家长姓名</label>
        <div class="layui-input-inline">
            <input  name="parents"  placeholder="家长姓名" autocomplete="off" class="layui-input" th:value="${student.parents}"/>
        </div>
        <label class="layui-form-label">家长电话</label>
        <div class="layui-input-inline">
            <input  name="parentsphone" placeholder="家长电话" autocomplete="off" class="layui-input" th:value="${student.parentsphone}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">面试人</label>
        <div class="layui-input-inline">
            <input  name="audition" placeholder="面试人" autocomplete="off" class="layui-input" th:value="${student.audition}"/>
        </div>
        <label class="layui-form-label">面试意见</label>
        <div class="layui-input-inline">
            <input  name="auditionoption"  placeholder="面试意见" autocomplete="off" class="layui-input" th:value="${student.auditionoption}"/>
        </div>
        <label class="layui-form-label">是否中专</label>
        <div class="layui-input-inline">
            <select name="isvocational">
                <option value="是" th:selected="${'是'==student.isvocational}">是</option>
                <option value="否" th:selected="${'否'==student.isvocational}">否</option>
            </select>
        </div>
        <label class="layui-form-label">中专学校</label>
        <div class="layui-input-inline">
            <input  name="vocationalsch" placeholder="中专学校" autocomplete="off" class="layui-input" th:value="${student.vocationalsch}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">中专学籍</label>
        <div class="layui-input-inline">
            <input  name="vocationalflag" placeholder="中专学籍" autocomplete="off" class="layui-input" th:value="${student.vocationalflag}"/>
        </div>
        <label class="layui-form-label">省录取号</label>
        <div class="layui-input-inline">
            <input  name="enrollno" placeholder="省录取号" autocomplete="off" class="layui-input" th:value="${student.enrollno}"/>
        </div>
        <label class="layui-form-label">录取成绩</label>
        <div class="layui-input-inline">
            <input  name="score" placeholder="录取成绩" autocomplete="off" class="layui-input" th:value="${student.score}"/>
        </div>
        <label class="layui-form-label">是否低保</label>
        <div class="layui-input-inline">
            <select name="dibao">
                <option value="是" th:selected="${'是'==student.dibao}">是</option>
                <option value="否" th:selected="${'否'==student.dibao}">否</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">生源类型</label>
        <div class="layui-input-inline">
            <input  name="sourcetype" placeholder="生源类型" autocomplete="off" class="layui-input" th:value="${student.sourcetype}" disabled="disabled"/>
        </div>
        <label class="layui-form-label">担保人</label>
        <div class="layui-input-inline">
            <input  name="guarantee"  placeholder="担保人" autocomplete="off" class="layui-input" th:value="${student.guarantee}"/>
        </div>
        <label class="layui-form-label">是否当兵</label>
        <div class="layui-input-inline">
            <select name="soldier">
                <option value="是" th:selected="${'是'==student.soldier}">是</option>
                <option value="否" th:selected="${'否'==student.soldier}">否</option>
            </select>
        </div>
        <label class="layui-form-label">报名号</label>
        <div class="layui-input-inline">
            <input  name="registration" placeholder="报名号" autocomplete="off" class="layui-input" th:value="${student.registration}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否住校</label>
        <div class="layui-input-inline">
            <select name="zhuxiao">
                <option value="是" th:selected="${'是'==student.zhuxiao}">是</option>
                <option value="否" th:selected="${'否'==student.zhuxiao}">否</option>
            </select>
        </div>
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input  name="remark" placeholder="备注" autocomplete="off" class="layui-input" th:value="${student.remark}"/>
        </div>
        <label class="layui-form-label">退学</label>
        <div class="layui-input-inline">
            <input  name="tuixue" placeholder="退学" autocomplete="off" class="layui-input" th:value="${student.tuixue}"/>
        </div>
        <label class="layui-form-label">休学</label>
        <div class="layui-input-inline">
            <input  name="xiuxue" placeholder="休学" autocomplete="off" class="layui-input" th:value="${student.xiuxue}"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学号</label>
        <div class="layui-input-inline">
            <input  name="stuno"  placeholder="学号" autocomplete="off" class="layui-input" th:value="${student.stuno}"/>
        </div>
        <label class="layui-form-label">是否送电脑</label>
        <div class="layui-input-inline">
            <select name="computer">
                <option value="是" th:selected="${'是'==student.computer}">是</option>
                <option value="否" th:selected="${'否'==student.computer}">否</option>
            </select>
        </div>
        <label class="layui-form-label">是否领用</label>
        <div class="layui-input-inline">
            <select name="collar">
                <option value="是" th:selected="${'是'==student.collar}">是</option>
                <option value="否" th:selected="${'否'==student.collar}">否</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">助学金</label>
        <div class="layui-input-inline">
            <input  name="grants"  placeholder="助学金" autocomplete="off" class="layui-input" th:value="${student.grants}"/>
        </div>
    </div>
    <div class="layui-form-item" style="margin-left: 275px">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重新填写</button>
        </div>
    </div>
</form>
</body>
<script th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:inline="none">
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        //你可以在这里做操作  也可以不使用这个方法
        form.on('submit(formDemo)', function(data){
            $.ajax({
                url: '/stu/upd',
                type: 'post',
                data:data.field,
                dataType: 'json',
                success:function(data){
                    if(data){
                        layer.msg(JSON.stringify("添加成功"));
                        //先得到当前iframe层的索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //再执行关闭
                        parent.layer.close(index);
                        window.parent.location.reload();
                    }
                },
            })
            //$('.layui-laypage-btn').click();//刷新
            return false;
        });
    });

    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#test2' //指定元素
        });
    });
</script>
</html>